import { stringify } from 'qs';
import request from '@/utils/request';

export async function fetch(params) {
  return request(`/clover/api/v1/banners?${stringify(params)}`);
}

export async function add(body) {
  return request(`/clover/api/v1/banners`, {
    method: 'POST',
    body,
  });
}

export async function remove({ id, ...body }) {
  return request(`/clover/api/v1/banners/${id}`, {
    method: 'DELETE',
    body,
  });
}

export async function update({ id, ...body }) {
  return request(`/clover/api/v1/banners/${id}`, {
    method: 'PUT',
    body,
  });
}